<template>
  <div class="XinZeng">
    <el-form-item label="用户名称">
      <el-input
        v-model="userData.username"
        type="text"
        placeholder="请输入用户名称"
      ></el-input>
    </el-form-item>
    <el-form-item label="用户密码">
      <el-input
        v-model="userData.password"
        type="text"
        placeholder="请输入用户密码"
      ></el-input>
    </el-form-item>
    <el-form-item label="昵称">
      <el-input
        v-model="userData.nickname"
        type="text"
        placeholder="请输入昵称"
      ></el-input>
    </el-form-item>
    <el-form-item label="电话">
      <el-input
        v-model="userData.phone"
        type="text"
        placeholder="请输入电话"
      ></el-input>
    </el-form-item>
    <el-form-item label="用户分数">
      <el-input
        v-model="userData.point"
        type="text"
        placeholder="请输入分数"
      ></el-input>
    </el-form-item>
  </div>
</template>

<script setup>
import {defineEmits,watch,reactive } from 'vue';


const emits = defineEmits(["XinZengUserData"]);

let id;
let username;
let password;
let nickname;
let phone;
let point;

const userData = reactive({
  id,
  username,
  password,
  nickname,
  phone,
  point,
});
watch(userData,()=>{
  console.log(userData);
  emits("XinZengUserData", userData)
})
</script>

<style lang="less" scoped>
.tianjia {
  padding: 30px 0;
}

.col {
  height: 38px;
}

.input {
  width: 200px;
}

.button {
  width: 70px;
  margin-left: 20px;
  margin-bottom: 30px;
}
</style>